﻿<Window x:Class="DisplayWindowModuleWpf.MessagWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MsgWindow" Height="100" Width="300" AllowsTransparency="True" WindowStyle="None" Name="MyWindow" Closing="MyWindow_Closing" Topmost="True" Loaded="MyWindow_Loaded" Background="#FFDDDDDD" ShowInTaskbar="False">
    <Window.Triggers>
        <EventTrigger RoutedEvent="Window.Loaded">
            <BeginStoryboard>
                <Storyboard>
                    <DoubleAnimation
                                    Storyboard.TargetName="MyWindow" 
                                    Storyboard.TargetProperty="Opacity"
                                    From="0.0" To="1" Duration="0:0:2" 
                                    AutoReverse="False"/>
                </Storyboard>
            </BeginStoryboard>
        </EventTrigger>
    </Window.Triggers>
    
    <Window.Resources>
        <ResourceDictionary>
            <Style x:Key="CloseButtonStyle" TargetType="{x:Type Button}">
                <Setter Property="Background" Value="Transparent" />
                <Setter Property="Foreground" Value="Black" />
                <Setter Property="HorizontalContentAlignment" Value="Center" />
                <Setter Property="VerticalContentAlignment" Value="Center" />
                <Setter Property="Padding" Value="1" />
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type Button}">
                            <Grid Background="{TemplateBinding Background}">
                                <ContentPresenter x:Name="contentPresenter"/>
                            </Grid>
                            <ControlTemplate.Triggers>
                                <Trigger Property="IsMouseOver" Value="True">
                                    <Setter TargetName="contentPresenter" Property="Opacity" Value="1" />
                                </Trigger>
                                <Trigger Property="IsMouseOver" Value="False">
                                    <Setter TargetName="contentPresenter" Property="Opacity" Value="0.3" />
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                    
                </Setter>
            </Style>

            <Style x:Key="DisplayNameStyle" TargetType="{x:Type Label}">
                <Setter Property="Control.FontSize" Value="14" />
                <Setter Property="Control.Foreground" Value="White" />
                <Setter Property="Effect">
                    <Setter.Value>
                        <DropShadowEffect
                                      ShadowDepth="1"
                                      Direction="295"
                                      Color="Black"
                                      Opacity="0.5"
                                     BlurRadius="10"/>
                    </Setter.Value>
                </Setter>
            </Style>

            <Style x:Key="MessageStringStyle" TargetType="{x:Type TextBlock}">
                <Setter Property="Control.FontSize" Value="14" />
                <Setter Property="Control.FontStyle" Value="Italic" />
                <Setter Property="Control.Foreground" Value="#1E2635" />
                <Setter Property="Effect">
                    <Setter.Value>
                        <DropShadowEffect
                                      ShadowDepth="1"
                                      Direction="295"
                                      Color="LightGray"
                                      Opacity="0.5"
                                     BlurRadius="6"/>
                    </Setter.Value>
                </Setter>
            </Style>
            <Storyboard x:Key="FadeOutStoryboard" Completed="FadeOutStoryboard_Completed">
            <DoubleAnimation
                                    Storyboard.TargetName="MyWindow" 
                                    Storyboard.TargetProperty="Opacity"
                                    From="1.0" To="0.0" Duration="0:0:2" 
                                    AutoReverse="False"/>
            </Storyboard>
        </ResourceDictionary>
    </Window.Resources>
    
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="285"/>
            <ColumnDefinition Width="15" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="30" />
            <RowDefinition Height="70" />
        </Grid.RowDefinitions>
        <Button Height="15" Width="15" Style ="{DynamicResource CloseButtonStyle}" HorizontalAlignment="Left"
                Name="btnOk" VerticalAlignment="Top" Click="btnClose_Click" Grid.Column="1">
            <Button.BorderBrush>
                <SolidColorBrush />
            </Button.BorderBrush>
            <Button.Background>
                <SolidColorBrush />
            </Button.Background>

            <Image Source="..\Images\closeX.png"/>

        </Button>
        <Label Content="Message:" Style="{StaticResource DisplayNameStyle}" Height="30" HorizontalAlignment="Left" Name="label1" VerticalAlignment="Top" Width="285" Grid.Column="0" Grid.Row="0"/>
        <TextBlock Margin="5,0,0,0" Style="{StaticResource MessageStringStyle}" Height="60" HorizontalAlignment="Left" Name="textBlock" VerticalAlignment="Top" Width="280" Grid.Column="0" Grid.Row="1" TextWrapping="Wrap"/>
    </Grid>
    <Window.BorderBrush>
        <LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5">
            <GradientStop Color="Black" Offset="0" />
            <GradientStop Color="White" Offset="1" />
        </LinearGradientBrush>
    </Window.BorderBrush>
</Window>
